/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package cn.gzjp.modules.logis.service;

import java.util.List;

import cn.gzjp.common.service.CrudService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.service.TreeService;
import cn.gzjp.common.utils.StringUtils;
import cn.gzjp.modules.logis.entity.AreaType;
import cn.gzjp.modules.logis.dao.AreaTypeDao;

/**
 * 树形地址Service
 * @author zengcp
 * @version 2018-05-30
 */
@Service
@Transactional(readOnly = true)
public class AreaTypeService extends CrudService<AreaTypeDao, AreaType> {

	public AreaType get(String id) {
		return super.get(id);
	}
	
	public List<AreaType> findList(AreaType areaType) {
		if (StringUtils.isNotBlank(areaType.getParentIds())){
			areaType.setParentIds(","+areaType.getParentIds()+",");
		}
		return super.findList(areaType);
	}
	
	@Transactional(readOnly = false)
	public void save(AreaType areaType) {
		super.save(areaType);
	}
	
	@Transactional(readOnly = false)
	public void delete(AreaType areaType) {
		super.delete(areaType);
	}
	
}